﻿using RuoVea.ExSugar.Attributes;
using System.ComponentModel.DataAnnotations;


namespace RuoVea.OmiApi.UserRole.Entitys;

/// <summary>
/// 角色表
/// </summary>
[SugarTable(nameof(SysRole), "角色表")]
[Description("角色表")]
[Tenant("0")]
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
public class SysRole : EntityBase, ITenantEntity
{
    /// <summary>
    /// 租户Id
    /// </summary>
    [ConfigSugarTenantColumn("TenantId", "租户Id", false, true, false)]
    public long? TenantId { get; set; }
    /// <summary>
    /// 名称
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(Name), columnDescription:"名称", Length = 64)]
    [Required, MaxLength(64)]
    public virtual string Name { get; set; }

    /// <summary>
    /// 编码
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(Code), columnDescription:"编码", Length = 64)]
    [MaxLength(64)]
    public string Code { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(Sort), columnDescription:"排序", IsNullable = true)]
    public int? Sort { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(100)]
    [ConfigSugarColumn(columnKey: nameof(Remark), columnDescription:"备注", Length = 128, IsNullable = true)]
    public string Remark { get; set; }

    /// <summary>
    /// 状态-正常_0、停用_1 
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(IsDisable), columnDescription:"状态-正常_0、停用_1", IsNullable = true)]
    public YesOrNot? IsDisable { get; set; } = YesOrNot.N;

}


